package org.dousb.douojbackendjudgeservice.judge.controller.inner;


import org.dousb.douojbackend.model.entity.QuestionSubmit;
import org.dousb.douojbackendjudgeservice.judge.JudgeService;
import org.dousb.douojbackendserviceclient.service.JudgeFeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * JudgeInnerController
 *
 * @author 豆沙包
 * @version 1.0
 * @since 2025-11-05  15:35
 */
@RestController
@RequestMapping("/inner")
public class JudgeInnerController implements JudgeFeignClient {

    @Resource
    private JudgeService judgeService;

    /**
     * 执行判题
     *
     * @param questionSubmitId
     */
    @Override
    @PostMapping("/do")
    public QuestionSubmit doJudge(@RequestParam("questionSubmitId") long questionSubmitId) {
        return judgeService.doJudge(questionSubmitId);
    }
}